package org.particles.domain;

import java.util.List;

public interface Vector {
	/**
	 * @return copy of coordinate.
	 */
	List<Double> getCoordinate();
	
	void setCoordinate(double... coordinate);
	
	void setCoordinate(List<Double> coordinate);
	
	/**
	 * add this vector to the passed vector.
	 * @return new vector as addition result.
	 */
	Vector addTo(Vector vector);
	
	/**
	 * add vector to this vector. thus the state of this vector will
	 * be changed.
	 */
	void add(Vector vector);
	
	/**
	 * subtracts this vector from the passed vector.
	 * @return new vector as subtraction result.
	 */
	Vector subtractFrom(Vector vector);
	
	/**
	 * subtract vector from this vector. thus the state of this vector will
	 * be changed.
	 */
	void subtract(Vector vector);
	
	/**
	 * @return new instance of vector as result of multiplication of this
	 * vector by the scalar.
	 */
	Vector multiplyBy(double scalar);
	
	/**
	 * multiplies this vector by scalar.
	 */
	void multiply(double scalar);
	
	/**
	 * copies state from vector to this vector.
	 */
	void copyStateFrom(Vector vector);
	
	/**
	 * @return length of this vector.
	 */
	double length();
	
	/**
	 * set this vector to the passed length.
	 * for this each vector component
	 * will be multiplied by newLength/oldLength.
	 */
	void setLength(double length);
	
	/**
	 * @return distance between vector and this vector
	 */
	double distanceTo(Vector vector);
}
